using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class CmsCategoryManagerBase
    {
        public CmsCategoryManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity Insert(CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity Update(CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity)Adapter.Update(obj);             
        }
 
 
        public CmsCategoryEntity Delete(CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity)Adapter.Delete(obj);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteByCatType (CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"CatType");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien CatType 
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteByCatType (string CatType )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.CatType = CatType;  
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"CatType");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteById (CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien Id 
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteById (Guid Id )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.Id = Id;  
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"Id");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteByIntId (CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"IntId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien IntId 
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteByIntId (int IntId )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.IntId = IntId;  
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"IntId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteByParentId (CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"ParentId");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien ParentId 
        /// </summary>
        /// <returns>CmsCategoryEntity</returns>
        public CmsCategoryEntity DeleteByParentId (Guid ParentId )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.ParentId = ParentId;  
            return (CmsCategoryEntity)Adapter.DeleteByField(obj,"ParentId");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public CmsCategoryEntity Select(CmsCategoryEntity obj)
        { 
            return (CmsCategoryEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(CmsCategoryEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(CmsCategoryEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new CmsCategoryEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new CmsCategoryEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<CmsCategoryEntity> SelectAllLST()
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new CmsCategoryEntity()),new CmsCategoryEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<CmsCategoryEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new CmsCategoryEntity(),option),new CmsCategoryEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (CmsCategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"CatType");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (CmsCategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"CatType",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByCatTypeLST (CmsCategoryEntity obj)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatType"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByCatTypeLST (CmsCategoryEntity obj,SelectOptions option)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"CatType",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (string CatType )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.CatType = CatType;  
            return Adapter.SelectByField(obj,"CatType");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByCatType (string CatType, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.CatType = CatType;  
            return Adapter.SelectByField(obj,"CatType",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByCatTypeLST (string CatType )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.CatType = CatType;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatType"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien CatType duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByCatTypeLST (string CatType, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.CatType = CatType;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"CatType",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (CmsCategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (CmsCategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByIdLST (CmsCategoryEntity obj)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByIdLST (CmsCategoryEntity obj,SelectOptions option)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"Id",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectById (Guid Id, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.Id = Id;  
            return Adapter.SelectByField(obj,"Id",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByIdLST (Guid Id )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.Id = Id;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien Id duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByIdLST (Guid Id, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.Id = Id;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"Id",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIntId (CmsCategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"IntId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIntId (CmsCategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"IntId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByIntIdLST (CmsCategoryEntity obj)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IntId"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByIntIdLST (CmsCategoryEntity obj,SelectOptions option)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"IntId",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIntId (int IntId )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.IntId = IntId;  
            return Adapter.SelectByField(obj,"IntId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByIntId (int IntId, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.IntId = IntId;  
            return Adapter.SelectByField(obj,"IntId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByIntIdLST (int IntId )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.IntId = IntId;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IntId"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien IntId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByIntIdLST (int IntId, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.IntId = IntId;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"IntId",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParentId (CmsCategoryEntity obj)
        { 
            return Adapter.SelectByField(obj,"ParentId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParentId (CmsCategoryEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"ParentId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByParentIdLST (CmsCategoryEntity obj)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"ParentId"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectByParentIdLST (CmsCategoryEntity obj,SelectOptions option)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"ParentId",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParentId (Guid ParentId )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.ParentId = ParentId;  
            return Adapter.SelectByField(obj,"ParentId");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByParentId (Guid ParentId, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.ParentId = ParentId;  
            return Adapter.SelectByField(obj,"ParentId",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByParentIdLST (Guid ParentId )
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.ParentId = ParentId;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"ParentId"),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien ParentId duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<CmsCategoryEntity> SelectByParentIdLST (Guid ParentId, SelectOptions option)
        { 
            CmsCategoryEntity obj = new CmsCategoryEntity();
            obj.ParentId = ParentId;  
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"ParentId",option),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectWithConditionLST (CmsCategoryEntity obj)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new CmsCategoryEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<CmsCategoryEntity></returns>
        public List<CmsCategoryEntity> SelectWithConditionLST (CmsCategoryEntity obj,SelectOptions option)
        { 
            return  (List<CmsCategoryEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new CmsCategoryEntity());
        }

}
}
